package com.base.cn.platform.os.service.course.classes.topic.reply;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 话题评论
 *
 * @author SK
 * @since 2018-05-31
 */
@FeignClient(value = CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface ClassesTopicReplyService extends CourseBaseService {

    /**
     * 查询话题评论列表
     *
     * @param classesTopicReply 班级话题评论查询条件
     * @param currentPage       第N页
     * @param pageSize          每页数据量
     * @param setCreator        设置评论人
     * @param setLeaf           设置评论的回复
     * @param setAllLeaf        设置评论的所有回复
     * @param isFront           是否是前端请求
     * @return 话题评论列表
     */
    @RequestMapping(contextPath + "/findClassesTopicReplyListPage")
    Map<String, Object> findClassesTopicReplyListPage(@RequestBody Map<String, Object> classesTopicReply,
                                                      @RequestParam(value = "currentPage", required = false, defaultValue = "1") Integer currentPage,
                                                      @RequestParam(value = "pageSize", required = false) Integer pageSize,
                                                      @RequestParam("setCreator") boolean setCreator,
                                                      @RequestParam("setLeaf") boolean setLeaf,
                                                      @RequestParam("setAllLeaft") boolean setAllLeaf,
                                                      @RequestParam("isFront") boolean isFront);

    /**
     * 保存话题评论
     *
     * @param params     话题评论
     * @param setCreator 设置评论人
     * @return 保存结果
     */
    @RequestMapping(contextPath + "/saveClassesTopicReply")
    Map<String, Object> saveClassesTopicReply(@RequestBody Map<String, Object> params,
                                              @RequestParam("setCreator") boolean setCreator);

    /**
     * 更新班级话题评论状态
     *
     * @param ids    班级话题评论id
     * @param status 1.正常 2.删除
     * @return 操作结果
     */
    @RequestMapping(contextPath + "/updateClassesTopicReplyStatus")
    Map<String, Object> updateClassesTopicReplyStatus(@RequestParam("ids") String ids,
                                                      @RequestParam("status") Integer status);

}
